home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
ddj1291.zip
/
STAT.ZIP
/
SOURCE.ZIP
/
PADEF.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-09
|
7KB
|
160 lines
/* File: padef.h
**
** Copyright 1990
** Fred Motteler and Applied Microsystems Corporation
** All Rights Reserved
**
** Description: This file contains #defines and structure definitions for the
** performance analysis module functions.
*/
/* Global defines */
#define PA_VERSION "1.0.0" /* Revision level */
#define PAMAX 1000 /* Max. no. of globals */
#define PA_SYM_LEN 17 /* Max. no. of significant chars */
#define PA_LINE_LEN 160 /* Max. no. of characters in line */
#define PA_BUFLEN 4096 /* Maximum number of samples */
/* Global error codes */
#define PA_BAD_HEX_E -1 /* Hex digit expected */
#define PA_NO_SYMBOL_E -2 /* Address value with no symbol */
#define PA_EARLY_END_E -3 /* File ended unexpectedly */
#define PA_TAB_FULL_E -4 /* Map table is full */
#define PA_NO_MEM_E -5 /* Out of memory */
#define PA_NO_WHERE_E -6 /* Can't exec "pawhere.exe" */
#define PA_NO_TMP_E -7 /* Can't find "pawhere.tmp" */
#define PA_BAD_TMP_E -8 /* Can't properly read "pawhere.tmp" */
#define PA_TMP_RM_E -9 /* Can't remove "pawhere.tmp" */
#define PA_ES_NORESP_E -10 /* ES 1800 not responding */
#define PA_NO_TUP_FILE_E -11 /* Can't open file for TUP response */
#define PA_NO_TUP_WR_E -12 /* Can't write to TUP response file */
#define PA_NOT_IMPL_E -13 /* Function not implemented */
#define PA_NO_EXEC_E -14 /* Can't exec test program */
#define PA_NO_PC_FILE_E -15 /* Can't open file for pc samples */
#define PA_NO_PC_WR_E -16 /* Can't write to pc sample file */
#define PA_CFG_SEEK_E -17 /* Can't seek to start of cfg file */
#define PA_CFG_FIELD_E -18 /* Can't find field in cfg file */
#define PA_FIELD_E -19 /* Field in cfg file is empty */
#define PA_BAD_DEL_E -20 /* Field has bad or no delimiter */
#define PA_BAD_ORDER_E -21 /* Bad symbol value order field */
#define PA_MAP_FMT_E -22 /* Bad map format specification */
#define PA_BSTEP_ZERO_E -23 /* Binary search step is zero */
#define PA_NO_PC_DEL_E -24 /* Can't remove pc sample file */
#define PA_NO_PC_RD_E -25 /* Can't read from pc sample file */
#define PA_NO_MAP_E -26 /* Can't open map file */
#define PA_NO_CFG_E -27 /* Can't open the configuration file */
#define PA_NO_HIT_BINS_E -28 /* No bins accumulated any hits */
#define PA_BAD_ARG_E -29 /* Bad argument passed */
#define PA_NO_LST_E -30 /* Can't open results listing file */
#define PA_NO_DRT_FILE_E -31 /* Can't open file for DRT response */
#define PA_NO_DRT_WR_E -32 /* Can't write to DRT response file */
#define PA_BAD_DRT_RD_E -33 /* Can't properly read DRT data */
#define PA_DCOUNT_OUT_E -34 /* DRT digit count is out of bounds */
#define PA_LCOUNT_OUT_E -35 /* DRT line count is out of bounds */
/* ES 1800 emulator "basic" processor types supported */
#define PA_020S 0 /* 68020 (supervisor prog. fetch) */
#define PA_020U 1 /* 68020 (user prog. fetch) */
#define PA_000S 2 /* 6800x/010/302 (sup. prog. fetch) */
#define PA_000U 3 /* 6800x/010/302 (user prog. fetch) */
#define PA_80X86 4 /* 80x8x */
#define PA_Z8K 5 /* Z800x */
/* ES 1800 emulator initial/final target state conditions */
#define PA_RST_RBV_STP 0 /* Use ESL "RST", "RBV", "STP" */
#define PA_RBK_STP 1 /* Use ESL "RBK", "STP */
#define PA_RBK_RUN 2 /* Use ESL "RBK", "RUN */
#define PA_BOMSYM "PA_BOT_MEM" /* String to identify bottom of mem. */
#define PA_TOPSYM "PA_TOP_MEM" /* String to identify top of memory */
#define PA_8086_TOP 0xfffffL /* Top of memory address for 8086 */
#define PA_68000_TOP 0xffffffL /* Top of memory address for 68000 */
#define PA_68020_TOP 0xffffffffL /* Top of memory address for 68020 */
#define PA_COMPORT "pa_comport:" /* RS-232 port to use */
#define PA_BAUDRATE "pa_baudrate:" /* Baud rate to use */
#define PA_ESTYPE "pa_estype:" /* Type of ES 1800 emulator to use */
#define PA_RUNSTOP "pa_runstop:" /* How to "run" and "stop" target sys */
#define PA_START_ID "pa_start_id:" /* String starting symbolic info */
#define PA_END_ID "pa_end_id:" /* String ending symbolic info */
#define PA_ORDER "pa_order:" /* String giving symbol/value order */
#define PA_FORMAT "pa_format:" /* sscanf() format string sym/val */
#define PA_SKIP1_ID "pa_skip1_id:" /* String on line(s) to ignore */
#define PA_SKIP2_ID "pa_skip2_id:" /* String on line(s) to ignore */
#define PA_PAGELINES "pa_pagelines:" /* Number of lines per display page */
#define PA_LISTFILE "pa_listfile:" /* Optional list file */
#define PA_SV_ID "sym val" /* Symbol / linear address format */
#define PA_SYM_VAL 1
#define PA_VS_ID "val sym" /* Linear address / symbol format */
#define PA_VAL_SYM 2
#define PA_SSO_ID "sym seg:off" /* Symbol / segmented address format */
#define PA_SYM_SEG 3
#define PA_SOS_ID "seg:off sym" /* Segmented address / symbol format */
#define PA_SEG_SYM 4
#define PA_SAMPLE "pasample.tmp" /* Temporary file of pc samples. */
#define PA_NO_DEBUG 0 /* No debugging information */
#define PA_SER_IN 1 /* Enable tracing of serial data in */
#define PA_GENERAL 2 /* Enable general debug messages */
#define PA_BACKSPACE 8
#define PA_TIMEOUT 10 /* Allow ten seconds for timeout. */
/* Global data structures */
struct padata { /* Structure for map entries */
unsigned long addressL; /* Starting address of module */
char symbolAB[PA_SYM_LEN]; /* Name of module */
unsigned long hitsL; /* Number of hits in this module */
};
/* Global variables */
extern struct padata *patableAHP[]; /* Table of ptrs to map data structs */
extern int pa_debugN; /* Debugging level */
/* Global functions - PC / ES 1800 independent */
/* ASCII hex to binary converter. */
extern int pa_hextobin();
/* Comparison routine for qsort() data by number of hits per function */
extern int pa_hitcomp();
/* Comparison routine for qsort() and bsearch() by function address */
extern int pa_addrcomp();
/* Eliminate functions with zero program counter hits */
extern int pa_zero_hits();
/* Print error message to standard out */
extern void pa_error();
/* Display results in page oriented form */
extern void padisply();
/* Page display support routine */
extern int pa_printf();
/* Search for string within other string */
extern char *pa_strsrch();
/* PC support functions. Internal interrupt driven program counter sampling */
/* PC interrupt CS:IP grabber support */
extern void paopen();
extern int paclose();
/* PC ".exe." program loader locator */
extern int pa_locate();
/* Collect program samples from a PC program */
extern int pa_pcsample();
/* ES 1800 support functions. External hardware address/status line sampling */
/* Send ES 1800 a string and wait for a '>' prompt reply */
extern int pa_essend();
/* Send a TUP command to the ES 1800 and process the response */
extern int pa_estup();
/* Send a DRT command to the ES 1800 and process the response */
extern int pa_esdrt();
/* Collect program samples from an ES 1800 */
extern int pa_essample();
/* Generic map file reader functions. */
/* Read configuration file */
extern int paconfig();
/* Read map file and allocate space for map entries */
extern int pardmap();
/* Free space used by map entries */
extern void paclear();